﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Panel.Master" Inherits="System.Web.Mvc.ViewPage<IList<Prodma.DataAccess.Models.ViewModels.GalleryCategoryVm>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	<%=System.Configuration.ConfigurationManager.AppSettings["pageTitle"] %>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <div class="listHeader">
        <img src="../../Images/ListImages/gallerylist.png" alt="" class="listHeaderIco" />
        <div class="listHeaderText">Galeri Kategori Yöneticisi</div>
        
        <div class="listHeaderMenuBox">
            <% Html.RenderPartial("/views/shared/userControls/navigation.ascx",
                   Prodma.DataAccess.Authorization.Authorization.GetNavigation("galleryCategory", 14));%>
        </div>
    </div>
    
    <div class="listFindBar">
        <% Html.RenderPartial("/views/shared/userControls/find.ascx",
               new Prodma.DataAccess.Models.UserControlViewModels.FindVm() { View = "galleryCategory", Keys = new List<string>() { "page" }, Values = new List<string>() { "0" } }); %>
    </div>
    
    <div class="listTitleContainer">
        <div class="listTitleCenter-50">#</div>
        <div class="listTitleCenter-50"><input type="checkbox" id="chk" name="chk" /></div>
        <div class="listTitleLeft-200">Adı</div>
        <div class="listTitleCenter-150">Galeri</div>
        <div class="listTitleCenter-150">Bölge</div>
        <div class="listTitleCenter-150">Durum</div>
        <div class="listTitleCenter-50">ID</div>
    </div>
    
    <div class="listRowContainer">
        <% int counter = 1; %>
        <% foreach (Prodma.DataAccess.Models.ViewModels.GalleryCategoryVm category in ViewData.Model) %>
        <% { %>
             <% if (counter % 2 != 0) %>
             <% { %>
                  <div class="listRow1">
                      <div class="listColumnCenter-50"><%=counter%></div>
                      <div class="listColumnCenter-50"><input type="checkbox" id='chk<%=category.Id %>' name="chkSelect" /></div>
                      <div class="listColumnLeft-200">
                        <a href='/galleryCategory/edit/?id=<%=category.Id %>&page=<%=Request.QueryString["page"] %>' class="listSelectItemBold">
                            <%=category.Name%>
                        </a>
                      </div>
                      <div class="listColumnCenter-150"><a href='/gallery/index/?category=<%=category.Id %>'><img src="../../Images/ListImages/galleryitem.png" alt="" /></a></div>
                      <div class="listColumnCenter-150"><%=category.Area.Name %></div>
                      <div class="listColumnCenter-150"><%=category.State.Name%></div>
                      <div class="listColumnCenter-50"><%=category.Id%></div>
                  </div>
             <% } %>
             <% else %>
             <% { %>
                  <div class="listRow2">
                      <div class="listColumnCenter-50"><%=counter%></div>
                      <div class="listColumnCenter-50"><input type="checkbox" id='chk<%=category.Id %>' name="chkSelect" /></div>
                      <div class="listColumnLeft-200">
                        <a href='/galleryCategory/edit/?id=<%=category.Id %>&page=<%=Request.QueryString["page"] %>' class="listSelectItemBold">
                            <%=category.Name%>
                        </a>
                      </div>
                      <div class="listColumnCenter-150"><a href='/gallery/index/?category=<%=category.Id %>'><img src="../../Images/ListImages/galleryitem.png" alt="" /></a></div>
                      <div class="listColumnCenter-150"><%=category.Area.Name %></div>
                      <div class="listColumnCenter-150"><%=category.State.Name%></div>
                      <div class="listColumnCenter-50"><%=category.Id%></div>
                  </div>
             <% } %>
             <% counter++; %>
        <% } %>
    </div>
    
    <div class="listFooter">
        <div class="listFooterData">Toplam Kayıt Sayısı : <%=ViewData["TotalRowCount"] %></div>
    </div>
    
    <div class="pagerContainer">
        <% Html.RenderPartial("/views/shared/userControls/dataPager.ascx", new Prodma.DataAccess.Models.UserControlViewModels.DataPagerVm()
           {
               View = "galleryCategory",
               TotalRowCount = Convert.ToInt32(ViewData["TotalRowCount"]),
               Keys = new List<string>() { "page" },
               Values = new List<string>() { "0" }
           }, new ViewDataDictionary()); %>
    </div>
    
    <script type="text/javascript">
        $(function() {
            $('#chk').click(function() {
            $("input[type='checkbox']").attr('checked', $('#chk').is(':checked')); 
            });
        });
    </script>

</asp:Content>
